// include/strategy/strategy_base.h

#ifndef STRATEGY_BASE_H
#define STRATEGY_BASE_H

#include "market_data.h"
#include <memory>
#include <string>
// 策略类的基类
class BaseStrategy {
public:
  virtual ~BaseStrategy() = default;

  virtual void OnTick(const Tick &tick) = 0;

  void SetBasicInfo(const std::string &lib_name,
                    const std::string &instance_name) {
    SetLibName(lib_name);
    SetInstanceName(instance_name);
  }

  void SetLibName(const std::string &lib_name) { lib_name_ = lib_name; }

  void SetInstanceName(const std::string &instance_name) {
    instance_name_ = instance_name;
  }

  const std::string &GetLibName() const { return lib_name_; }

  const std::string &GetInstanceName() const { return instance_name_; }

private:
  std::string lib_name_;
  std::string instance_name_;
};

// 策略工厂类，用于创建策略实例
class StrategyFactory {
public:
  virtual ~StrategyFactory() = default;
  virtual BaseStrategy *CreateStrategy(const std::string &config_path) = 0;
};

#endif // STRATEGY_BASE_H